Create model export automation scripts#668
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces automation for exporting trained nanoGPT models to ExecuTorch format. The implementation adds a new model_exports.executorch module with export utilities, integrates automatic export into the experiment runner and hyperparameter search scripts, and provides tooling for profiling exported models on Android devices.
Key changes:
- New ExecuTorch export module with checkpoint-to-PTE conversion and smoke testing
- Automated export hooks in experiment and hyperparameter search workflows
- Android device profiling utilities via ADB
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| optimization_and_search/run_experiments.py | Added CLI flags for ExecuTorch export and automatic export after each experiment run |
| model_exports/executorch/exporter.py | Core export logic including checkpoint preparation, ExecuTorch program generation, and smoke tests |
| model_exports/executorch/export_checkpoint.py | CLI interface for standalone checkpoint export |
| model_exports/executorch/init.py | Module initialization and public API exports |
| hyperparam_search.py | Integrated ExecuTorch export options and hooks into hyperparameter search trials |
| hardware_targets/android/profile_pte.py | Android device profiling via ADB with metric extraction |
| hardware_targets/README.md | Documentation for hardware profiling tools |
| demos/export_ckpt_to_executorch.sh | Shell script wrapper for checkpoint export |
| demos/README.md | Documentation for ExecuTorch export demo |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '--executorch-export', | ||
| dest='executorch_export', | ||
| action='store_true', | ||
| default=True, |
There was a problem hiding this comment.
Setting default=True with action='store_true' is redundant and can cause confusion. When action='store_true', the default is already False. To enable by default while still allowing --no-executorch-export to disable, remove the default=True from this argument - the default behavior is controlled by the --no-executorch-export flag's action='store_false'.
| default=True, |
| "--executorch_export", | ||
| dest="executorch_export", | ||
| action='store_true', | ||
| default=True, |
There was a problem hiding this comment.
Same issue as in run_experiments.py: default=True with action='store_true' is redundant. Remove the default=True parameter.
| default=True, |
No description provided.